# Makefile for linux0.11/boot
# 
# Programs, flags, etc.

LD = ld
LDFLAGS = -r
CC = gcc -march=i486
CFLAGS = -Wall -fno-stack-protector -finline-functions -nostdinc -I../include
CPP = gcc -E -nostdinc -I../include

# This Program

.c.S:
	$(CC) $(CFLAGS) -S -o $*.S $<
.S.o:
	$(CC) $(CFLAGS) -c -o $*.o $<
.c.o:
	$(CC) $(CFLAGS) -c -o $*.o $<

# All Phony Targets
.PHONY : all clean 

# Default starting position
all : head.o

clean :
	rm -f *.o setup bootsect

setup : setup.o
	ld -Ttext 0x0 -s --oformat binary setup.o -o setup -e _start
debug-setup : setup.o
	ld -Ttext 0x0 -e _start setup.o -o setup

bootsect : bootsect.o
	ld -Ttext 0x0 -s --oformat binary bootsect.o -o bootsect -e _start

